<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>


<style>
.portaltb {
	font-weight: normal;
	padding-bottom: 5px;
	color: #555;
	font-size: 12px;
	table-layout: fixed;
	width: 100%;
	cursor: pointer;
	margin: 0px 5px;
}

.portaltb tr {
	height: 30px;
}

.ptd1 {
	text-overflow: ellipsis;
	-moz-text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
	width: 67%;
}

.ptd1:hover {
	text-decoration: underline;
}

.ptd2 {
	text-overflow: ellipsis;
	-moz-text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
}

.linkMore {
	position: absolute;
	bottom: 10px;
	right: 20px;
	color: #555;
}

.linkMore:hover {
	text-decoration: underline;
}
</style>

<div>
	<table class="portaltb" id="containTb">
		<c:forEach items="${newTop10Entities}" var="warmEntiry">
			<tr>
				<td align="left" class="ptd1"><a
					href="javascript:view('${warmEntiry.id }')">${warmEntiry.title}</a>
					<c:if test="${warmEntiry.importanceLevel eq '重要' }">
						<img alt="" src="img/portal/impt.png" title="重要"
							style="margin-left:5px;">
					</c:if>
				</td>
				<td align="center" class="ptd2"><fmt:formatDate
						value="${warmEntiry.createDate}" pattern="yyyy-MM-dd" /></td>
			</tr>
		</c:forEach>
	</table>
	<a class="linkMore" href="announcement/announcement/searchResultView"
		target="_black">更多></a>
</div>
<script type="text/javascript">
   window.setInterval("reflash()", 60000);
   function reflash()
   {
     window.location.reload();
   }

	function view(id) {
		var tempTitle = "公告详情";
		var tempUrl = "announcement/announcement/infoView?id=" + id;
		var options = {
			title : tempTitle,
			contentUrl : tempUrl
		};
		isperp.openDialog(options);
	}

	
	function loadDate() {
		$("#containTb").html("");
		$.ajax({
			url : 'announcement/announcement/getData',
			data : {
				rownum : '5'
			},
			success : function(data) {
				var trStr = "";
				if (data) {
					var leg = data.length;
					for ( var i = 0; i < leg; i++) {
						var id = data[i].id;
						trStr += "<td align=\"left\" class=\"ptd1\"><a href='javascript:view(" + id + ")'>" + data[i].title + "<a>";
						if (data[i].importanceLevel == "重要")
							trStr += "<img alt=\"\" src=\"img/portal/impt.png\" title=\"重要\" style=\"margin-left:5px;\">";
                        trStr+="</td>";						
					}

				}
			}
		});
	}
</script>


